#ifndef DRV_UART_H
#define DRV_UART_H

#include "main.h"

typedef enum {
    UART_USART1,
    UART_USART2,
    UART_NUM_MAX,
} drv_uart_port_t;

void drv_uart_init(drv_uart_port_t huart, unsigned int baudreate);
void drv_uart_deinit(drv_uart_port_t huart);
void drv_uart_irq_handler(drv_uart_port_t huart);
unsigned char drv_uart_rx_is_empty(drv_uart_port_t huart);
void drv_uart_write_data(drv_uart_port_t huart, const unsigned char *buffer, unsigned short length);
unsigned char drv_uart_read_byte(drv_uart_port_t huart);

#endif